# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.TPU.V2.Model.QueuedResourceState do
  @moduledoc """
  QueuedResourceState defines the details of the QueuedResource request.

  ## Attributes

  *   `acceptedData` (*type:* `GoogleApi.TPU.V2.Model.AcceptedData.t`, *default:* `nil`) - Output only. Further data for the accepted state.
  *   `activeData` (*type:* `GoogleApi.TPU.V2.Model.ActiveData.t`, *default:* `nil`) - Output only. Further data for the active state.
  *   `creatingData` (*type:* `GoogleApi.TPU.V2.Model.CreatingData.t`, *default:* `nil`) - Output only. Further data for the creating state.
  *   `deletingData` (*type:* `GoogleApi.TPU.V2.Model.DeletingData.t`, *default:* `nil`) - Output only. Further data for the deleting state.
  *   `failedData` (*type:* `GoogleApi.TPU.V2.Model.FailedData.t`, *default:* `nil`) - Output only. Further data for the failed state.
  *   `provisioningData` (*type:* `GoogleApi.TPU.V2.Model.ProvisioningData.t`, *default:* `nil`) - Output only. Further data for the provisioning state.
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. State of the QueuedResource request.
  *   `stateInitiator` (*type:* `String.t`, *default:* `nil`) - Output only. The initiator of the QueuedResources's current state. Used to indicate whether the SUSPENDING/SUSPENDED state was initiated by the user or the service.
  *   `suspendedData` (*type:* `GoogleApi.TPU.V2.Model.SuspendedData.t`, *default:* `nil`) - Output only. Further data for the suspended state.
  *   `suspendingData` (*type:* `GoogleApi.TPU.V2.Model.SuspendingData.t`, *default:* `nil`) - Output only. Further data for the suspending state.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :acceptedData => GoogleApi.TPU.V2.Model.AcceptedData.t() | nil,
          :activeData => GoogleApi.TPU.V2.Model.ActiveData.t() | nil,
          :creatingData => GoogleApi.TPU.V2.Model.CreatingData.t() | nil,
          :deletingData => GoogleApi.TPU.V2.Model.DeletingData.t() | nil,
          :failedData => GoogleApi.TPU.V2.Model.FailedData.t() | nil,
          :provisioningData => GoogleApi.TPU.V2.Model.ProvisioningData.t() | nil,
          :state => String.t() | nil,
          :stateInitiator => String.t() | nil,
          :suspendedData => GoogleApi.TPU.V2.Model.SuspendedData.t() | nil,
          :suspendingData => GoogleApi.TPU.V2.Model.SuspendingData.t() | nil
        }

  field(:acceptedData, as: GoogleApi.TPU.V2.Model.AcceptedData)
  field(:activeData, as: GoogleApi.TPU.V2.Model.ActiveData)
  field(:creatingData, as: GoogleApi.TPU.V2.Model.CreatingData)
  field(:deletingData, as: GoogleApi.TPU.V2.Model.DeletingData)
  field(:failedData, as: GoogleApi.TPU.V2.Model.FailedData)
  field(:provisioningData, as: GoogleApi.TPU.V2.Model.ProvisioningData)
  field(:state)
  field(:stateInitiator)
  field(:suspendedData, as: GoogleApi.TPU.V2.Model.SuspendedData)
  field(:suspendingData, as: GoogleApi.TPU.V2.Model.SuspendingData)
end

defimpl Poison.Decoder, for: GoogleApi.TPU.V2.Model.QueuedResourceState do
  def decode(value, options) do
    GoogleApi.TPU.V2.Model.QueuedResourceState.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.TPU.V2.Model.QueuedResourceState do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
